'''
Created on Feb 13, 2014

@author: yfrank
'''
import os

def ensure_dir(path):
    if not os.path.exists(path):
        os.makedirs(path)
    return os.path.exists(path)


class switch(object):
    value = None
    def __new__(self, value):
        self.value = value
        return True

def case(*args):
    return any((arg == switch.value for arg in args))